from core.basehandler import BaseHandler
from core.room import Room
from items.oilcan import OilCan
from items.lamp import Lamp
from core.action import Action

class EntranceHall(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        self.add_item(Lamp())
        self.add_item(OilCan())
        
        # build list of actions
        self.add_action(GPO)
        self.add_action(FCC)
        self.add_action(Classroom)
        self.add_action(Cornwalls)
        self.add_action(CareerFair)
    
    # return description of room.
    def get_description(self):
        return "You are standing in awe in the main lobby. The Globe or World Domination towers ominously over you."
    
    # return image of room
    def get_image(self):
        return 'entrance_hall.jpg'


class EntranceHallHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return EntranceHall

# define actions for this room

class GPO(Action):
    def __init__(self):
        Action.__init__(self, "GPO")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the GPO"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'GPO'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"


class FCC(Action):
    def __init__(self):
        Action.__init__(self, "FCC")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Career Center"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'FCC'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class Classroom(Action):
    def __init__(self):
        Action.__init__(self, "Classroom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to class"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'Classroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class Cornwalls(Action):
    def __init__(self):
        Action.__init__(self, "Cornwalls")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to your home away from home, Cornwalls"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'Cornwalls'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class CareerFair(Action):
    def __init__(self):
        Action.__init__(self, "CareerFair")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the CareerFair"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'CareerFair'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    